package com.xiangxiangjd.mapper;

import com.xiangxiangjd.bean.Topic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 肖守凯
 * @since 2021-05-05
 */
public interface TopicMapper extends BaseMapper<Topic> {



    /** 分页查询Topic
     * @param map.page  页码
     * @param map.limit  查几条
     * @param map.topic  前端传进的参数
     * @return 返回统一分页信息
     */
    List<Topic> selectMyPage(@Param("map") Map map);
    Integer countMyPage(@Param("map") Map map);

    void updateSorts(Integer topicSort);

    List<Topic> selectTopicAllAnswer(@Param("questionnaireId") String questionnaireId, @Param("type")String type, @Param("sort")Integer sort );

    List<Topic> beforeAllTopic(@Param("questionnaireId") String questionnaireId, @Param("sort")Integer sort );

    List<Topic> selectQuestionnaireAllTopic(String questionnaireId);
}
